package com.fr.report.web.ui.impl;

import com.fr.base.core.json.JSONException;
import com.fr.base.core.json.JSONObject;
import com.fr.base.core.util.TemplateUtils;
import com.fr.data.impl.CustomDictionary;
import com.fr.report.js.JavaScriptImpl;
import com.fr.report.web.event.Listener;
import com.fr.report.web.ui.ComboBox;
import com.fr.report.web.ui.WebContentUtils;
import com.fr.web.Repository;

public class Scale extends ComboBox
{
  public Scale()
  {
    setEditable(false);
    setDictionary(new CustomDictionary(new String[] { "0.25", "0.75", "1.0", "1.2", "1.5", "2.0", "4.0" }, new String[] { "25%", "75%", "100%", "120%", "150%", "200%", "400%" }));
  }

  public Listener[] createListeners(Repository paramRepository)
  {
    return new Listener[] { new Listener("selectchange", new JavaScriptImpl(TemplateUtils.render("${CP}.zoom(this.getValue())", "CP", WebContentUtils.getContentPanel(paramRepository)))) };
  }

  public JSONObject createJSONConfig(int paramInt1, int paramInt2, Object paramObject, Repository paramRepository)
    throws JSONException
  {
    return super.createJSONConfig("100%", paramRepository);
  }

  public boolean equals(Object paramObject)
  {
    return ((paramObject instanceof Scale) && (super.equals(paramObject)));
  }
}